home *** CD-ROM | disk | FTP | other *** search
- #include "my color.h"
-
- do_activate(an_event)
- EventRecord *an_event;
- {
- CWindowPeek peek;
- ControlHandle control;
-
- peek = (CWindowPeek)an_event->message;
- if (an_event->modifiers & 01)
- { /*application window is becoming active*/
- SetPort((CGrafPtr)an_event->message);
- SelectWindow((CWindowPtr)an_event->message);
- EnableItem (myMenus[fileM],closeItem);
- DisableItem(myMenus[editM],undoItem);
- control = peek->controlList;
- while(control)
- {
- ShowControl(control);
- control = (*control)->nextControl;
- }
- DrawGrowIcon((CWindowPtr)an_event->message);
- } /*if an_event->modifiers*/
- else /*application window is becoming inactive*/
- {
- if (((CWindowPeek)FrontWindow())->windowKind > 0)
- {
- control = peek->controlList;
- while(control)
- {
- HideControl(control);
- control = (*control)->nextControl;
- }
- DrawGrowIcon((CWindowPtr)an_event->message);
- EnableItem (myMenus[editM], undoItem);
- scrapErr = ZeroScrap();
- }/*if WindowPeek*/
- else
- DisableItem (myMenus[editM], undoItem);
- } /*else*/
- }
-